home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / pdsrt212.zip / PDSORT.DOC < prev    next >
Text File  |  1990-06-19  |  15KB  |  306 lines

  1.                                    PDSORT
  2.                    A Public Domain External Sort Program
  3.  
  4. Author:   Don A. Williams
  5. Version:  2.1.2
  6. Date:     June 20, 1990
  7.  
  8.    ****************************  NOTICE!  **************************
  9.    *   Contrary to the current trend  in  MS-DOS  software  this   *
  10.    *   program,  for  whatever  it is worth,  is NOT copyrighted   *
  11.    *   (with the exception of the runtime library  from  Borland   *
  12.    *   International's  Turbo  C)!  The program,  in whole or in   *
  13.    *   part,  may be used freely in any fashion  or  environment   *
  14.    *   desired.  If  you  find this program to be useful to you,   *
  15.    *   do NOT send any contribution to the author;  in the words   *
  16.    *   of  Rick  Conn,   'Enjoy!'  However,   if  you  make  any   *
  17.    *   improvements,  I would enjoy  receiving  a  copy  of  the   *
  18.    *   modified  source.  I  can  be reached,  usually within 24   *
  19.    *   hours,  by  messages  on  any  of  the  Phoenix  systems,   *
  20.    *   particularly:                                               *
  21.    *                                                               *
  22.    *               The Tool Shop BBS       [PCBOARD]               *
  23.    *                   (602) 279-2673   1200/2400/9600 bps         *
  24.    *                   (Good luck trying!  VERY BUSY!)             *
  25.    *               Technoids Anonymous     [PCBOARD]               *
  26.    *                   (602) 899-4876   300/1200/2400 bps          *
  27.    *                                                               *
  28.    *   All can be reached through PC Pursuit.                      *
  29.    *                                                               *
  30.    *   or:                                                         *
  31.    *                on GEnie, mail address: DON-WILL               *
  32.    *                on CompuServ:           75410,543              *
  33.    *                                                               *
  34.    *   Every  effort has been made to avoid error and moderately   *
  35.    *   extensive testing has been  performed  on  this  program,   *
  36.    *   however, the author does not warrant it to be fit for any   *
  37.    *   purpose  or  to  be  free  from  error  and disclaims any   *
  38.    *   liability for actual or any other damage arising from the   *
  39.    *   use of this program.                                        *
  40.    *****************************************************************
  41.  
  42. PDSORT is a fully public domain external sort  program,  i.e.  it  can 
  43. sort  files  that  are  too big to be wholly contained in memory.  The 
  44. length of the file that can be sorted by PDSORT is limited only by the 
  45. available disk space,  however,  you must have at least twice as  much 
  46. free  space  as  the  length of the file to be sorted - PDSORT uses an 
  47. intermediate file the size of the input file  and  the  sorted  output 
  48. file will be the same size as the input file.  
  49.  
  50.  
  51. USAGE: 
  52.  
  53. There are two forms for executing PDSORT: 
  54.  
  55.     pdsort in_file out_file [option] max_record_length [key_spec ....]
  56.  
  57. and:
  58.  
  59.     pdsort - [option] max_record_length [key_spec ....] <in_file >out_file
  60.  
  61. In the first form,  the input_file specification can be  any  standard 
  62. MS-DOS  file  specification including full path specifications but may 
  63. NOT contain "wild cards".  The output_file specification may  also  be 
  64. any  standard  MS-DOS  file specification not containing "wild cards".  
  65. The input_file and output_file names may be  the  same  but,  in  this 
  66. case,  the  input_file  will  be destroyed by PDSORT by overwriting it 
  67. with the input file.  The max_record_length argument is  required  and 
  68. no  records  in  the input file may exceed this value.  If a record is 
  69. detected in the input file that exceeds the specified  maximum  record 
  70. length,  PDSORT  will  issue a message identifying the record and will 
  71. terminate.  
  72.  
  73. In the second form, PDSORT executes as a "filter", reading and sorting 
  74. standard input to produce  standard  output,  both  of  which  may  ne 
  75. redirected.  
  76.  
  77.  
  78. Options:
  79.  
  80. The only options supported by version 2.0.0 of PDSORT are: 
  81.  
  82.     -······A single '-',  delimited by  blanks,  instructs  PDSORT  to 
  83.            operate  as a filter,  taking its input from standard input 
  84.            and sending its output to standard output.  
  85.  
  86.     -tpath·The '-t option allows the user to specify the path for  the 
  87.            intermediate  file  created  by PDSORT.  If no such path is 
  88.            specified,  PDSORT will use the path of the output file as 
  89.            the  path of the intermediate file.  If the "filter" option 
  90.            is selected and no intermediate file path is specified, the 
  91.            intermediate file will be created in the current directory.  
  92.  
  93.  
  94. Key Specification:
  95.  
  96. There  may  be  as  many keys specified as you wish.  The file will be 
  97. sorted on the keys in the order in  which  they  are  specified.  Each 
  98. key_spec has one of the following two formats: 
  99.  
  100.     b:l:[field_options]
  101.  
  102. or:
  103.  
  104.     b-e:[field_options]
  105.  
  106. where:
  107.  
  108.     b·-·Specifies  the  beginning  character  position of the field in 
  109.         decimal;  i.e to sort a field that is in columns 10 through 17 
  110.         of the record, b would be 10.
  111.     l·-·Specifies the length of the field in characters; i.e to sort a 
  112.         field that is in columns 10 through 17 of the record,  l would 
  113.         be 8 - 10:8[:options].
  114.     e·-·Specifies the  ending  character  position  of  the  field  in 
  115.         decimal,  inclusive;  i.e to sort a file that is in characters 
  116.         10 through 17 of the record with  this  format  of  the  field 
  117.         specifier would require the e be 17 - 10-17[:options].
  118.  
  119. Field Options:
  120.  
  121.     a·-·Specifies  that  the  sort on this field is to be in ascending 
  122.         order,  the default if no field option is specified  for  this 
  123.         field.  
  124.  
  125.     d·-·Specifies  that  the sort on this field is to be in descending 
  126.         order.  
  127.  
  128.     c·-·Specifies that the sort on this field is to be case sensitive; 
  129.         i.e.  the  word  Abscess"  would  sort  lower  that  the  word 
  130.         "abscess".  A  case  sensitive  sort  is the default if none 
  131.         is specified.  
  132.  
  133.     i·-·Specifies  that  the  sort  on  this  field  is  to  be   case 
  134.         insensitive.  
  135.  
  136.     c·-·Specifies that this field is ASCII character data, the default 
  137.         if  not  specified.  Since  PDSORT  2.0.0  supports only ASCII 
  138.         character fields, this option if only for upward compatibility 
  139.         with future version of PDSORT that  may  support  other  field 
  140.         types such as integer (numeric).  
  141.  
  142.  
  143.  
  144. Examples:
  145.  
  146. Assume  a  file,  named  FILELIST,  that contains a list of file name, 
  147. sizes, date/times, and paths, such as can be created by NUFIND: 
  148.  
  149.     a----w           27,974 90-04-30  6:30 c:\acelst.430
  150.     a----w           28,196 90-05-21  5:05 c:\acelst.521
  151.     a----w           28,238 90-05-25  5:41 c:\acelst.525
  152.     a----w           26,705 90-05-25  5:39 c:\acelst.lst
  153.     a----w          128,537 90-05-25  5:41 c:\acelst.zip
  154.     a----w              904 90-05-23  4:33 c:\autoexec.bat
  155.     a----w           35,840 89-06-30 12:16 c:\command.com
  156.     a----w               46 89-08-20  3:53 c:\config.cal
  157.     a----w              284 90-05-21 19:52 c:\config.sys
  158.     a----w            2,128 90-05-23  4:32 c:\configur.dat
  159.     ------           39,385 89-07-14 12:00 c:\drbdos.sys
  160.     ------           18,304 89-06-30 12:16 c:\drbios.sys
  161.     ---sh-            4,096 90-03-18 13:22 c:\drildr.sys
  162.     a----w              167 89-10-11  7:56 c:\dsas.cmd
  163.     a----w              102 86-11-04  9:14 c:\ed.def
  164.     a----w           50,326 86-10-02 21:34 c:\ed.hlp
  165.     a----w            3,362 86-06-09 13:10 c:\fakey.com
  166.     a----w                0 90-05-23  7:54 c:\ftf.dat
  167.     a----w           12,275 85-06-16 18:12 c:\helpe.def
  168.     a----w               79 89-05-17  5:02 c:\indent.pro
  169.     a----w            7,122 90-01-15  1:00 c:\lineend.com
  170.     a----w            1,060 90-05-25  9:40 c:\mark0
  171.     a--sh-               41 90-05-25  9:40 c:\mi